﻿Public Class Walet
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If ProgressWalet.Value < 100 Then
            ProgressWalet.Value += 5
        ElseIf ProgressWalet.Value = 100 Then
            Button2.Visible = True
        End If
    End Sub

    Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        If ProgressWalet.Value > 0 Then
            ProgressWalet.Value -= 5
            Button2.Visible = False
        ElseIf ProgressWalet.Value = 0 Then
            Timer1.Enabled = False
            Me.Dispose()
            MainForm.checkWalet()
        End If
    End Sub

    Sub start()
        ProgressWalet.Value = 100
        Button2.Visible = False
        Button1.Visible = True
        Timer1.Enabled = True
    End Sub

    Sub stopTimer()
        Timer1.Enabled = False
        Button1.Visible = False
    End Sub


    Private Sub Walet_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Timer1.Enabled = False
        Button2.Visible = False
        Button1.Visible = False
        ProgressWalet.Value = 100
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        MainForm.Label2.Text += 3000
        If MainForm.Label2.Text = 32000 Then
            MainForm.enableNextLevel()
        ElseIf MainForm.Label2.Text = 17000 Then
            MainForm.enableNextLevel()
        End If

        Button2.Visible = False
    End Sub
End Class
